const path = require('path');
function resolve (dir) {
    return path.join(__dirname, dir)
}

module.exports = {
// webpack-dev-server 的配置项
	devServer: {
		host: '0.0.0.0',
		disableHostCheck: true,
		proxy: {
			'/api' : {
				target: 'http://localhost:8080',
				changeOrigin: true,
				pathRewrite: {
					'^/api' : '/static/mock'
				}
			}
		}
	},
	chainWebpack: (config)=>{
        config.resolve.alias
            .set('@', resolve('src'))
			.set('assets',resolve('src/assets'))
			.set('styles', resolve('src/assets/css'))
            .set('components',resolve('src/components'))
	}
}